<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>测试</title>
		<link href="../css/ceshi.css" rel="stylesheet">
		
	</head>
	<body>

  <div class="carousel-box">
    
    <div class="carousel-img">
    <img src="../img/tutu.jpg" width="1000" height="460" alt="" />
    </div>
    <div class="carousel-img">
    <img src="../img/tutu3.png" width="1000" height="460" alt="" />
    </div>
	<div class="carousel-img">
	 <img src="../img/tutu2.webp" width="1000" height="460" alt="" />
	</div>
	<div class="carousel-img">
	<img src="../img/tutu.jpg" width="1000" height="460" alt="" />
	</div>
	<div class="cleft">&lt;</div>
	<div class="cright">&gt;</div>
  </div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
	 <script type="text/javascript">
		 $(function(){
			 var index=0;  //标记当前索引
			 setInterval(function(){
				 if(index==$(".carousel-img").length-1)                // index==3    
				 {
					 index=0;
					  $(".carousel-img").css("opacity","0");
				 $(".carousel-img").eq(index).css("opacity","1");
				 }else{
					  index++;
					  $(".carousel-img").css("opacity","0");
					  $(".carousel-img").eq(index).css("opacity","1");
				 }
			 },4000)
			 $(".cleft ").click(function(){
				 if(index==0){
					 index=$(".carousel-img").length-1;
					 $(".carousel-img").css("opacity","0");
					 $(".carousel-img").eq(index).css("opacity","1");
				 }else{
					  index--;
				 $(".carousel-img").css("opacity","0");
				 $(".carousel-img").eq(index).css("opacity","1");
				 }
			 })
			 $(".cright").click(function(){
				if(index==$(".carousel-img").length-1){
					 index=0;
					 $(".carousel -img").css("opacity","0");
					 $(".carousel-img").eq(index).css("opacity","1");
				}else{
									  index++;
				$(".carousel-img").css("opacity","0");
				$(".carousel-img").eq(index).css("opacity","1");
				}
			 })
		 })
	 </script>
 
	</body>
</html>


<div class="banner-box">
					<a href="#">
						<img src="../img/dia-important1.jpg" alt="ban" />
					</a>
					
					
					
	<div class="slide">
						<ul>
							<li><a href="#">周年活动</a><i class="iconfont">&#8594;</i>
							<div class="slide-list">
								<img src="../img/datu00.jpg"/>
							</div>
							</li>
							<li><a href="#">决斗体验</a><i class="iconfont">&#8594;</i>
							<div class="slide-list">
								<img src="../img/datu0.jpg" alt=""/>
							</div>
							</li>
							<li><a href="#">新忍登场</a><i class="iconfont">&#8594;</i>
							<div class="slide-list">
								<img src="../img/tutu3.png" alt=""/>
							</div>
							</li>
							<li><a href="#">赛事热门</a><i class="iconfont">&#8594;</i>
							<div class="slide-list">
								<img src="../img/datu5.jpg" alt=""/>
							</div>
							</li>
							<li><a href="#">版本前瞻</a><i class="iconfont">&#8594;</i>
							<div class="slide-list">
								<img src="../img/tutu.jpg" alt=""/>
							</div>
							</li>
						</ul>
					</div>